using ORS.OrderRobot.Domain;
using ORS.OrderRobot.ServiceContracts.Dtos;

namespace ORS.OrderRobot.ServiceContracts
{
    /// <summary>
    /// JWT服务接口
    /// </summary>
    public interface IJwtService
    {
        /// <summary>
        /// 生成JWT Token
        /// </summary>
        /// <param name="admin">管理员信息</param>
        /// <returns>JWT Token</returns>
        string GenerateToken(AdminDto admin);

        /// <summary>
        /// 验证JWT Token
        /// </summary>
        /// <param name="token">JWT Token</param>
        /// <returns>验证结果</returns>
        bool ValidateToken(string token);

        /// <summary>
        /// 从Token中获取用户ID
        /// </summary>
        /// <param name="token">JWT Token</param>
        /// <returns>用户ID</returns>
        int? GetUserIdFromToken(string token);
    }
} 